﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Utils;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Repository;
using DevExpress.XtraGrid.Columns;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraGrid.Views.Grid.ViewInfo;
using DevExpress.XtraTab.Buttons;
using FileManager_Client.PresentationLayer.Properties;
using log4net.Appender;

namespace FileManager_Client.PresentationLayer
{
    public partial class ServerMain : DevExpress.XtraEditors.XtraForm
    {
        public ServerMain()
        {
            InitializeComponent();
            LookAndFeel.SetSkinStyle("Wizard97");
        //    gridView1.Appearance.VertLine.BorderColor = Color.Transparent;
          //  gridView1.Appearance.VertLine.BackColor = Color.Transparent;
          //  gridView1.Appearance.VertLine.BackColor2 = Color.Transparent;

       //     DevExpress.XtraEditors.Repository.RepositoryItemProgressBar test = new RepositoryItemProgressBar();
       //     gridView1.Columns["Test2"].ColumnEdit = test;
       //     DevExpress.XtraEditors.Repository.RepositoryItemButtonEdit test2 = new RepositoryItemButtonEdit();
       //     test2.NullText = "下载";
       //       DevExpress.XtraEditors.Repository.RepositoryItemImageEdit image = new RepositoryItemImageEdit();
       //     image.PictureAlignment = ContentAlignment.MiddleLeft;
       //     Image im1 = Image.FromFile(@"Folder_Icon\48x48\folder.png");
       //     image.Images = im1;
       //    //image.
       //     test2.Buttons.Clear();
       //     test2.Buttons.Add(new CustomHeaderButton());
       //     test2.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(test2_ButtonClick);
       //     gridView1.Columns["Test1"].ColumnEdit = test2;
       //     foreach (GridColumn column in gridView1.Columns)
       //     {
       //         column.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;
       //     }
       //     gridView1.RowHeight = 50;
       //     gridView1.ColumnPanelRowHeight = 40;
       //  //  gridView1.ShowLoadingPanel();
       //     //gridControl1.Height = 50;
       ////     gridView1.ShowButtonMode = ShowButtonModeEnum.ShowAlways;
       //     gridControl1.Paint += new PaintEventHandler(gridControl1_Paint);
       //     gridView1.ScrollStyle = ScrollStyleFlags.LiveVertScroll;
       //     List<ListObj> listObjs = new List<ListObj>();
       //    // gridView1.OptionsView.ShowHorizontalLines = DevExpress.Utils.DefaultBoolean.False;
       //     gridView1.OptionsView.ShowVerticalLines = DevExpress.Utils.DefaultBoolean.False;
       //     gridView1.OptionsView.ShowPreviewRowLines = DevExpress.Utils.DefaultBoolean.False;
       //     for (int i = 0; i < 50; i++)
       //     {
       //         listObjs.Add(new ListObj
       //                          {
       //                              Test2 = i+5,
       //                              Test3 = i.ToString()//,
       //                             // Test1 = i.ToString()
       //                          });
       //     }
       //     gridControl1.DataSource = listObjs;

        
        }

        //void gridControl1_Paint(object sender, PaintEventArgs e)
        //{
        //    //GridViewInfo vi = gridView1.GetViewInfo() as GridViewInfo;
        //    //Point p1 = new Point(vi.ColumnsInfo[gridView1.Columns[0]].Bounds.Right - 1, vi.ViewRects.Rows.Y);
        //    //Point p2 = new Point(vi.ColumnsInfo[gridView1.Columns[0]].Bounds.Right - 1, vi.ViewRects.Rows.Bottom);
        //    //Pen p = new Pen(gridView1.PaintAppearance.HorzLine.BackColor);
        //    //e.Graphics.DrawLine(p, p1, p2);
        //}

        //void test2_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        //{
            
        //}
    }

    public class ListObj
    {
        public string Test1 { get; set; }
        public int Test2 { get; set; }
        public string Test3 { get; set; }
    }
}